package org;
import java.util.Scanner;
import java.util.Iterator;
import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.criterion.Restrictions;

import vo.Custom;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;


public class Checkuser {

	/**
	 * @param args
	 * @param name 
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		SessionFactory sf = new Configuration().configure()
				.buildSessionFactory();
		Session session = sf.openSession();
		Scanner input=new Scanner(System.in);
		String aaa=input.next();
		String hql="from Custom custom where custom.customname like '%"+aaa+"%'";
		Query query=session.createQuery(hql); 
		List list=query.list();
		Iterator it=list.iterator();
		while(it.hasNext()){
			Custom custom=(Custom)it.next();
			System.out.println(custom.getCustomname());
		}
		

	}

}
